import request from '@utils/request'

// 查询菜单列表
export function getMenuList (data) {
  return request({
    url: '/menu/getPageLit',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增菜单信息
export function addMenu (data) {
  return request({
    url: '/menu/save',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改菜单信息
export function changeMenu (data) {
  return request({
    url: '/menu/update',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除菜单信息
export function deleteMenu (query) {
  return request({
    url: '/menu/delete',
    method: 'post',
    params: query,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}